import pytest, time
from selenium.webdriver.common.by import By


class ProductCmsLocator:
    """
        User Center 页面
    """
    # 首页提示弹框返回按钮
    product_cancel_button = (By.XPATH,'/html/body/div[3]/div/div[2]/div/div[2]/div/div/div[2]/button[1]/span')
    # 首页菜单按钮//*[@id="root"]/section/div/div/div[1]
    product_menu_button = (By.XPATH,'//*[@id="root"]/section/div/div/div[1]')
    # 菜单页面
    product_menu_page = (By.XPATH,'//*[@id="root"]/section/div/div/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div')
    # CMS菜单按钮
    cms_menu_button = (By.XPATH,'//*[@id="root"]/section/div/div/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div/div[2]/div/div/div[5]/div[5]/div[2]')
    # cms控制台页面标题
    cms_console_title = (By.XPATH,'//*[@id="teamix-container"]/div[2]/div[1]/div[1]/div')
    # cms控制台页面 //*[@id="icestarkNode"]/div[1]/main
    cms_console_page = (By.CSS_SELECTOR, '[id="icestarkNode"]')
    # cms的overview页面标题            //*[@id="icestarkNode"]/div[1]/main/section[2]/section[1]/div/header/section/section[1]/section[1]/span
    cms_overview_title = (By.XPATH,'(//section[@class="teamix-pro-page-header-left"])[1]/section[1]/span')
    # monitoring_overview标签
    cms_monitoring_overview_label = (By.XPATH,'(//ul[@class="next-tabs-nav next-disable-animation"])[1]/li[1]/div')
    # Alerting Cloud products栏标题
    cms_alerting_cloud_products_title = (By.XPATH,'(//div[@class="teamix-pro-card-title-name"])[1]/span[1]/span')
    # Alert Rules栏标题
    cms_alert_rules_title = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div[2]/div/div/div/div/div[1]/div[2]/div/div/div/div[1]/div[2]/div/div/div/span[1]')
    # Event-triggered Alert Rules栏标题
    cms_event_triggered_alert_rules_title = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div[2]/div/div/div/div/div[2]/div[1]/div/div/div[1]/div[2]/div/div/div/span/span')
    # Alert History栏标题
    cms_alert_history_title = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div[2]/div/div/div/div/div[2]/div[2]/div/div/div[1]/div[2]/div/div/div/span/span')
    # Dashboards标题
    cms_dashboards_title = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div[2]/div/div/div/div/div[3]/div/div/div/div[1]/div/div/div/div/span/span')
    # iframe
    into_iframe = (By.CSS_SELECTOR,'[id="hj_container"]')

    # CMS页面
    # Cloud Service Monitori标签[id="512"] //*[@id="512"]/span/span/span
    cms_csm_title = (By.CSS_SELECTOR,'[id="512"]')
    # Cloud Service Monitori页面
    cms_csm_page = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/div[1]/div[1]/div')
    # Elastic Compute Service (ECS)标签按钮
    cms_ecs_title_btn = (By.XPATH, '//*[@id="multi"]/div[1]/div[1]/div/div/div/div/div/div/a/span/span/span')
    # ECS页面实例页面
    cms_ecs_example_apge = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div')
    # ECS实例搜索类型下拉按钮
    cms_ecs_example_btn = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div[1]/div/div[1]/div[1]/div[2]/div/form/span/span[1]/span/span[1]/span[2]/span/i')
    # ECS搜索类型下拉框
    cms_csm_btn_box = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul')
    # ECS搜索类型名称Instance Name按钮
    cms_ecs_instance_name_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li[1]/div/span')
    # ECS搜索类型Instance ID按钮
    cms_csm_instance_id_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li[2]/div/span')
    # ECS搜索类型Classic Network Intranet IP按钮
    cms_csm_network_ip_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li[3]/div/span')
    # ECS搜索类型Elastic IP Address按钮
    cms_csm_address_ip_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li[6]/div/span')
    # ECS搜索类型Status按钮
    cms_csm_status_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li[7]/div/span')

    # ECS 页面的Monitoring Charts按钮
    ecs_monitoring_charts_btn = (By.XPATH, '(//tr[@class="next-table-row first last"])/td[13]/div/div/button')
    # ECS 页面的Elastic Compute Service (ECS)监控图表页面
    ecs_monitoring_charts_page = (By.CSS_SELECTOR, '[class="page-header-select-node"]')
    # OS Monitoring标签按钮
    ecs_os_monitoring_btn = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div[1]/div/div[1]/div/div/div/ul/li[1]/div')
    # ECS监控页面的1Hour时间按钮
    ecs_1hour_btn = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div[2]/div[1]/div[1]/div/div/label[1]/span[2]')
    # ECS监控页面的CPU utilization(%)表格标题
    ecs_cpu_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[1]/span/span')
    # ECS监控页面的Memory usage(%)表格标题
    ecs_memory_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[2]/span/span')
    # ECS监控页面的System load(value)表格标题
    ecs_system_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[3]/span/span')
    # ECS监控页面的DiskUsage(%)表格标题
    ecs_diskusage_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[4]/span/span')
    # ECS监控页面的Number of bytes read(bytes/s)表格标题
    ecs_num_read_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[5]/span/span')
    # ECS监控页面的Number of bytes written(bytes/s)表格标题
    ecs_num_written_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[6]/span/span')
    # CSM页面的tab栏按钮
    # CSM页面Elastic Computing标签tab按钮
    cms_elasti_tab = (By.XPATH, '//*[@id="multi"]/div[2]/ul/li[1]/span/a/span')
    # CSM页面Application Services标签tab按钮
    cms_app_services_tab = (By.XPATH, '//*[@id="multi"]/div[2]/ul/li[2]/span/a/span')
    # CSM页面Database标签tab按钮
    cms_db_tab = (By.XPATH, '//*[@id="multi"]/div[2]/ul/li[3]/span/a/span')
    # CSM页面Storage & CDN标签tab按钮
    cms_storage_tab = (By.XPATH, '//*[@id="multi"]/div[2]/ul/li[4]/span/a/span')
    # CSM页面Network标签tab按钮
    cms_network_tab = (By.XPATH, '//*[@id="multi"]/div[2]/ul/li[5]/span/a/span')
    # CSM页面RDS标签按钮
    cms_rds_title = (By.XPATH, '//*[@id="multi"]/div[1]/div[3]/div/div/div/div/div[1]/div/a/span/span/span')
    # CSM页面RDS页面的RDS实例
    cms_rds_example_title = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div[1]/div[2]')
    # CSM页面RDS页面告警规则按钮
    cms_rds_rules_btn = (By.XPATH, '//*[@class="teamix-pro-form-query-filter-inline"]/div/form/span/span/span/span/span[1]')
    # CSM页面RDS告警规则Instance Name按钮
    cms_rds_instance_name_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li[1]/div/span')
    # CSM页面RDS告警规则Instance ID按钮
    cms_rds_instance_id_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li[2]/div/span')

    # CSM页面SLB标签按钮
    cms_slb_title = (By.XPATH, '//*[@id="multi"]/div[1]/div[5]/div/div/div/div/div[2]/div/a/span/span/span')
    # CSM页面SLB页面标签标题
    cms_slb_page = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[1]/header/section[2]/section[1]/section/span/div/div/span/span[1]/span[1]/em')
    # CSM页面SLB实例页面
    cms_slb_example_page = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[2]')
    # CSM页面SLB告警搜索类型按钮
    cms_slb_rules_btn = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[1]/div/div[1]/div[1]/div[2]/div/form/span/span[1]/span/span[1]/span[2]/span/i')
    # CSM页面SLB告警规则Instance Name按钮
    cms_slb_instance_name_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div[1]/ul/li[1]/div/span')
    # CSM页面SLB告警规则Instance ID按钮
    cms_slb_instance_id_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div[1]/ul/li[2]/div/span')
    # CSM页面SLB告警规则Ip Address按钮
    cms_slb_ip_address_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div[1]/ul/li[3]/div/span')

    # CSM页面SLB页面的Monitoring Charts按钮
    slb_monitoring_charts_btn = (By.XPATH,'(//tr[@class="next-table-row first"])[1]/td[6]/div/div/div/div/div[1]/div/a')
    # SLB的监控页面
    slb_monitoring_charts_page = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]')
    # SLB监控页面的custom标题按钮
    slb_custom_title_btn = (By.XPATH, '(//div[@class="cms-monitor-product-content"])/div[1]/div[1]/div/div/label[9]/span[2]')
    # SLB监控页面的 Inbound Bandwidth(bits/s)栏标题
    slb_inbound_bndwidth_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[1]/span/span')
    # SLB监控页面的 Outbound Bandwidth(bits/s)栏标题
    slb_outbound_bandwidths_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[2]/span/span')
    # SLB监控页面的 Sum of inflow bandwidth(bits/s)栏标题
    slb_sum_inflow_bandwidth_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[3]/span/span')
    # SLB监控页面的 Sum of outflow bandwidth(bits/s)栏标题
    slb_sum_outflow_bandwidth_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[4]/span/span')
    # SLB监控页面的 Number of New Connections(Count)栏标题
    slb_num_new_connections_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[5]/span/span')
    # SLB监控页面的 Number of Inbound Data Packets(Count/s)栏标题
    slb_num_inbound_data_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[6]/span/span')
    # SLB监控页面的 Number of Outbound Data Packets(Count/s)栏标题
    slb_num_outbound_data_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[7]/span/span')

    # CSM页面OSS标签按钮
    cms_oss_title = (By.XPATH, '//*[@id="multi"]/div[1]/div[4]/div/div/div/div/div[2]/div/a/span/span/span')
    # CSM页面OSS页面标签标题
    cms_oss_page = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[1]/header/section[2]/section[1]/section/span/div/div/span/span[1]/span[1]/em')
    # CSM页面OSS实例页面
    cms_oss_example_page = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[2]')
    # CSM页面OSS告警搜索类型按钮
    cms_oss_rules_btn = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[1]/div/div[1]/div[1]/div[2]/div/form/span/span[1]/span/span[1]')
    # CSM页面OSS告警规则Bucket Name按钮
    cms_oss_bucket_name_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li/div/span')

    # CSM页面OSS页面的Monitoring Charts按钮
    oss_monitoring_charts_btn = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[2]/div[2]/div[2]/table/tbody/tr/td[5]/div/div/div/div/div[1]/div/a')
    # OSS的监控页面
    oss_monitoring_charts_page = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]')
    # OSS监控页面的custom标题按钮
    oss_custom_title_btn = (By.XPATH, '(//div[@class="cms-monitor-product-content"])/div[1]/div[1]/div/div/label[9]/span[2]')
    # OSS监控页面的Availability/Valid Request Rate(%)(%)栏标题
    oss_valid_request_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[1]/span/span')
    # OSS监控页面的Total Number of Requests/Number of Valid Requests(Count)栏标题
    oss_valid_requests_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[2]/span/span')
    # OSS监控页面的Traffic(byte)栏标题
    oss_traffic_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[3]/span/span')
    # OSS监控页面的MeteringStorageUtilization(byte)栏标题
    oss_meteringstorageutilization_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[4]/span/span')
    # OSS监控页面的MeteringStorageUtilizationGB(Gbytes)栏标题
    oss_meteringstorageutilizationGB_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[5]/span/span')
    # OSS监控页面的Storage Usage(%)栏标题
    oss_storage_usage_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[6]/span/span')

    # CSM页面VPN Gateways标签按钮
    cms_vpn_gw_title = (By.XPATH, '//*[@id="multi"]/div[1]/div[5]/div/div/div/div/div[4]/div/a/span/span/span')
    # CSM页面VPN Gateways页面标签标题
    cms_vpn_gw_page = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[1]/header/section[2]/section[1]/section/span/div/div/span/span[1]/span[1]/em')
    # CSM页面VPN Gateways实例页面
    cms_vpn_gw_example_page = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[2]')
    # CSM页面VPN Gateways告警搜索类型按钮
    cms_vpn_gw_rules_btn = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[1]/div/div[1]/div[1]/div[2]/div/form/span/span[1]/span/span[1]')
    # CSM页面VPN Gateways告警规则Instance ID按钮
    cms_vpn_gw_instance_id_btn = (By.XPATH, '(//div[@class="next-overlay-wrapper opened"])/div/ul/li/div/span')

    # CSM页面VPN Gateways页面的Monitoring Charts按钮
    vpn_gateways_monitoring_charts_btn = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]/section[2]/section[2]/section/section/div/div/div/div[1]/div[2]/div[2]/div[2]/table/tbody/tr/td[7]/div/div/div/div/div[1]/div/a')
    # VPN Gateways的监控页面
    vpn_gateways_monitoring_charts_page = (By.XPATH, '//*[@id="icestarkNode"]/div[1]/main/section[2]')
    # VPN GatewaysS监控页面的custom标题按钮
    vpn_gateways_custom_title_btn = (By.XPATH, '(//div[@class="cms-monitor-product-content single-tab"])/div[1]/div[1]/div/div/label[9]/span[2]')
    # VPN Gateways监控页面的IPSec.connection.rxPkgs(pps)栏标题
    vpn_gatewayss_rxpkgs_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[1]/span/span')
    # VPN Gateways监控页面的IPSec.connection.txpkgs(pps)栏标题
    vpn_gateways_txpkgs_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[2]/span/span')
    # VPN Gateways监控页面的IPSec.connection.rx.rate(bits/s)栏标题
    vpn_gatewayss_rx_rate_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[3]/span/span')
    # VPN Gateways监控页面的IPSec.connection.tx.rate(bits/s)栏标题
    vpn_gateways_tx_rate_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[4]/span/span')
    # VPN Gateways监控页面的SSL Client Count(unit)栏标题
    vpn_gatewayss_ssl_client_title = (By.XPATH, '(//div[@class="teamix-pro-card-title-name"])[5]/span/span')






